package enterprise.manage.entity;

import javax.persistence.*;

/**
 * Created by IntelliJ IDEA.
 * User: zhenmingyue
 * Date: 2012-11-20
 * Time: 21:15:17
 * 产品库存记录
 */
@Entity
@Table(schema = "mg", name = "product_type")
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
public class ProductType {
    private Long id;
    /**
     * 产品类型
     */
    private String type;
    /**
     * 品牌
     */
    private String brand;
    /**
     * 型号
     */
    private String model;
    /**
     * 单价
     */
    private String price;
    /**
     * 押金
     */
    private String deposit;
    /**
     * 支持地区
     */
    private String supportArea;
    /**
     * 剩量
     */
    private String quantity;
    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getDeposit() {
        return deposit;
    }

    public void setDeposit(String deposit) {
        this.deposit = deposit;
    }

    public String getSupportArea() {
        return supportArea;
    }

    public void setSupportArea(String supportArea) {
        this.supportArea = supportArea;
    }

    public String getQuantity() {
        return quantity;
    }

    public void setQuantity(String quantity) {
        this.quantity = quantity;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ProductType products = (ProductType) o;

        if (brand != null ? !brand.equals(products.brand) : products.brand != null) return false;
        if (deposit != null ? !deposit.equals(products.deposit) : products.deposit != null) return false;
        if (id != null ? !id.equals(products.id) : products.id != null) return false;
        if (model != null ? !model.equals(products.model) : products.model != null) return false;
        if (price != null ? !price.equals(products.price) : products.price != null) return false;
        if (quantity != null ? !quantity.equals(products.quantity) : products.quantity != null) return false;
        if (supportArea != null ? !supportArea.equals(products.supportArea) : products.supportArea != null)
            return false;
        if (type != null ? !type.equals(products.type) : products.type != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (type != null ? type.hashCode() : 0);
        result = 31 * result + (brand != null ? brand.hashCode() : 0);
        result = 31 * result + (model != null ? model.hashCode() : 0);
        result = 31 * result + (price != null ? price.hashCode() : 0);
        result = 31 * result + (deposit != null ? deposit.hashCode() : 0);
        result = 31 * result + (supportArea != null ? supportArea.hashCode() : 0);
        result = 31 * result + (quantity != null ? quantity.hashCode() : 0);
        return result;
    }
}